import React from 'react';
import {Badge} from 'antd';
import showLogDetails from '../components/SysLog';
import Constants from "../utils/Constants";
import Utils from "../utils";


module.exports = [
  {
    key: 'id',
    title: 'ID',
    dataType: 'int',
    primary: true,
    showType: 'normal',
    showInTable: false,
    showInForm: true,
    disabled: true,
    render: (text, record) => text
  },

  {
    key: 'username',
    title: 'Username',
    dataType: 'varchar',
  },

  {
    key: 'logType',
    title: '日志类型',
    dataType: 'varchar',
    showInTable: false,
  },
  {
    key: 'methodType',
    title: 'CURD',
    dataType: 'int',
    showType: 'select',
    options: Utils.map2kvArr(Constants.SYS_LOG_OPERA_MAP),
  },
  {
    key: 'entity',
    title: 'Entity',
    dataType: 'varchar',
  },
  {
    key: 'dataId',
    title: 'TabId',
    dataType: 'int',
  },
  {
    key: 'methodDescription',
    title: 'Description',
    dataType: 'varchar',
    showInTable: false
  },
  {
    key: 'requestMethod',
    title: 'Method',
    dataType: 'varchar',
  },
  {
    key: 'requestParams',
    title: 'Params',
    dataType: 'varchar',
    showInTable: false
  },
  {
    key: 'requestUrl',
    title: 'Route',
    showInTable: false,
    dataType: 'varchar',
  },
  {
    key: 'requestIp',
    title: 'Ip',
    dataType: 'varchar',
  },
  {
    key: 'requestCode',
    title: 'Code',
    dataType: 'varchar',
  },
  {
    key: 'exceptionDetail',
    title: '异常描述',
    dataType: 'varchar',
    showInTable: false,
  },
  {
    key: 'createTime',
    title: 'Time',
    dataType: 'varchar',
    showInForm: false,
  },
  {
    key: 'singleRecordActions',
    title: 'Other',  // 列名
    actions: [
      {
        name: '查看详情',
        type: 'component',
        component: showLogDetails,
      },
    ]
  }

];